package com.vercon.moensmart.newtork.interceptor;

import androidx.annotation.Nullable;

import com.vercon.common.network.NetErrorException;

import java.io.IOException;

import okhttp3.Authenticator;
import okhttp3.Request;
import okhttp3.Response;
import okhttp3.Route;

public class TokenAuthenticator implements Authenticator {
   
    @Nullable
    @Override
    public Request authenticate(@Nullable Route route, Response response) throws IOException {
        int code = response.code();
        if (code == NetErrorException.LOGIN_OUT) {
              //TODO Token过期
        }
        return response.request();
    }
}